package com.shark.example.controllers
{
	import com.shark.example.events.LoginEvent;
	import com.shark.example.vos.User;
	
	import flash.events.IEventDispatcher;

	public class MainController
	{
		[Dispatcher]
		public var dispatcher:IEventDispatcher;
		
		[Bindable]
		[Inject (source="loginController.user", bind="true")]
		public var user:User;
		
		public function MainController()
		{	
		}
		
		[EventHandler(event="LoginEvent.LOGOUT_REQUEST")]
		public function logoutRequest(event:LoginEvent):void{
			dispatcher.dispatchEvent(new LoginEvent(LoginEvent.LOGOUT_SUCCESS));
		}
	}
}